<script>
	import api from './api.js';
	export default {
		onLaunch: function() {
			//#ifdef APP-PLUS
			var userinfo = uni.getStorageSync('user');
			if(userinfo ){
				const data = {
					id: userinfo.id,
				};
				api.post({
					url:'api/getInfo.do',
					data:data,
					success(res) {
						if(res.isSuccess){
							uni.setStorageSync('user',res.data)						
						}else{
							uni.showToast({
								icon: 'none',
								title: res.data,
							});
						}
					}
				})
				
			}
			
			
			/* 5+环境锁定屏幕方向 */
			//plus.screen.lockOrientation('portrait-primary'); //锁定
			plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {  
				if(widgetInfo.appid=='HBuilder')return false;
				api.get({  
					url: '/update.json',  
					/* data: {  
						version: widgetInfo.version,  
						name: widgetInfo.name  
					},  */
					success: (result) => {  
						var wgtUrl = result.wgtUrl;  
						if (result.version!=widgetInfo.version && wgtUrl) {  
							uni.downloadFile({  
								url: wgtUrl,  
								success: (downloadResult) => {  
									if (downloadResult.statusCode === 200) {  
										plus.runtime.install(downloadResult.tempFilePath, {  
											force: false  
										}, function() {  
											console.log('install success...');  
											plus.runtime.restart();  
										}, function(e) {  
											console.error('install fail...');  
										});
									}  
								}  
							});  
						}  
					}  
				});  
			});  
			// #endif  
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			//console.log('App Hide')
		}
	}
</script>

<style>
	/* 这是页面的公用css */

	@import "./common/uni.css";

	page {
		/* background-color: #F8F8F8; */
		height: 100%;
		font-size: 32upx;
		line-height: 1.6;
		background-color: #efeff4;
	}

	checkbox,
	radio {
		margin-right: 10upx;
	}

	button {
		margin-top: 20upx;
		margin-bottom: 20upx;
	}

	form {
		width: 100%;
	}
	.input-row.border{
		padding: 5px 0;
	}
	/* page */

	/* #ifdef MP-BAIDU */
	page {
		width: 100%;
		height: 100%;
		display: block;
	}

	swan-template {
		width: 100%;
		min-height: 100%;
		display: flex;
	}

	/* #endif */

	.content {
		display: flex;
		flex: 1;
		flex-direction: column;
		background-color: #efeff4;
		padding: 20upx;
	}

	.input-group {
		background-color: #ffffff;
		/* margin-top: 40upx; */
		position: relative;
	}

	/* .input-group::before {
        position: absolute;
        right: 0;
        top: 0;
        left: 0;
        height: 1upx;
        content: '';
        -webkit-transform: scaleY(.5);
        transform: scaleY(.5);
        background-color: #c8c7cc;
    } */

	/* .input-group::after {
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0;
        height: 1upx;
        content: '';
        -webkit-transform: scaleY(.5);
        transform: scaleY(.5);
        background-color: #c8c7cc;
    } */

	.input-row {
		display: flex;
		flex-direction: row;
		position: relative;
	}

	.input-row .title {
		font-size: 28upx;
		width: 150upx;
		height: 40upx;
		min-height: 40upx;
		padding: 20upx 0 20upx 20upx;
		line-height: 40upx;
	}

	.input-row.border::after {
		position: absolute;
		right: 0;
		bottom: 0;
		left: 0;
		height: 1upx;
		content: '';
		-webkit-transform: scaleY(.5);
		transform: scaleY(.5);
		background-color: #c8c7cc;
	}


	.btn-row {
		margin-top: 50upx;
		padding: 20upx;
	}

	.container {
		display: flex;
		flex-direction: column;
		min-height: 100%;
		justify-content: space-between;
		font-size: 32upx;
		font-family: -apple-system-font, Helvetica Neue, Helvetica, sans-serif;
	}

	.page-head {
		padding: 60upx 50upx 80upx;
		text-align: center;
		line-height: initial;
		height: 60upx;
	}

	.page-head-title {
		display: inline-block;
		padding: 0 40upx;
		font-size: 30upx;
		height: 60upx;
		line-height: 60upx;
		color: #BEBEBE;
		box-sizing: border-box;
		border-bottom: 2upx solid #D8D8D8;
	}

	.page-head-desc {
		padding-top: 20upx;
		color: #9B9B9B;
		font-size: 32upx;
	}

	.page-body {
		width: 100%;
		flex-grow: 1;
		overflow-x: hidden;
	}

	.page-body-wrapper {
		display: flex;
		flex-direction: column;
		align-items: center;
		width: 100%;
	}

	.page-body-wording {
		text-align: center;
		padding: 200upx 100upx;
	}

	.page-body-info {
		display: flex;
		flex-direction: column;
		align-items: center;
		background-color: #fff;
		width: 100%;
		padding: 50upx 0 150upx 0;
	}

	.page-body-title {
		margin-bottom: 100upx;
		font-size: 32upx;
	}

	.page-body-text {
		font-size: 30upx;
		line-height: 52upx;
		color: #ccc;
	}

	.page-body-text-small {
		font-size: 24upx;
		color: #000;
		margin-bottom: 100upx;
	}

	.page-foot {
		margin: 100upx 0 30upx 0;
		text-align: center;
		color: #1aad19;
		font-size: 0;
	}

	.icon-foot {
		width: 152upx;
		height: 23upx;
	}

	.page-section {
		width: 100%;
		/* margin-bottom: 60upx; */
	}

	.page-section_center {
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.page-section:last-child {
		margin-bottom: 0;
	}

	.page-section-gap {
		box-sizing: border-box;
		padding: 0 30upx;
	}

	.page-section-spacing {
		box-sizing: border-box;
		padding: 0 80upx;
	}

	.page-section-title {
		font-size: 28upx;
		color: #999999;
		margin-top: 10upx;
		margin-bottom: 10upx;
		padding-left: 30upx;
		padding-right: 30upx;
	}

	.page-section-gap .page-section-title {
		padding-left: 0;
		padding-right: 0;
	}

	/* example */

	.index-hd {
		padding: 90upx;
		text-align: center;
	}

	.index-logo {
		width: 140upx;
		height: 140upx;
	}

	.btn-area {
		margin-top: 60upx;
		box-sizing: border-box;
		width: 100%;
		padding: 0 30upx;
	}

	.image-plus {
		width: 150upx;
		height: 150upx;
		border: 2upx solid #D9D9D9;
		position: relative;
	}

	.image-plus-nb {
		border: 0;
	}

	.image-plus-text {
		color: #888888;
		font-size: 28upx;
	}

	.image-plus-horizontal {
		position: absolute;
		top: 50%;
		left: 50%;
		background-color: #d9d9d9;
		width: 4upx;
		height: 80upx;
		transform: translate(-50%, -50%);
		-webkit-transform: translate(-50%, -50%);
	}

	.image-plus-vertical {
		position: absolute;
		top: 50%;
		left: 50%;
		background-color: #d9d9d9;
		width: 80upx;
		height: 4upx;
		transform: translate(-50%, -50%);
		-webkit-transform: translate(-50%, -50%);
	}

	.color1 {
		background-color: #1AAD19;
		color: #FFFFFF;
	}

	.color2 {
		background-color: #2782D7;
		color: #FFFFFF;
	}

	.color3 {
		background-color: #F1F1F1;
		color: #353535;
	}

	uni-input,
	uni-input input {
		min-height: 40upx;
	}
</style>

<style lang="scss">
	.process {
		font-size: 24upx;
		line-height: 40upx;
		padding: 20upx 0;

		&.loading {
			color: #c7c7c7;
		}

		&.success {
			color: #44cc24;
		}

		&.refuse {
			color: #f00;
		}

		&.upx-font {
			font-size: 28upx;
		}
	}

	.input-row {
		.title {
			.i-color {
				color: #DD524D;
			}
		}

		.uni-view {
			flex: 1;
			font-size: 28upx;
			line-height: 40upx;
			margin-left: 16upx;
			padding: 20upx 0;
		}
	}
	
	.overtime-list-wrapper {
		height: 100%;
		.no-data-box{
			height: 100%;
			background: #fff;
			display: flex;
			align-content: center;
			align-items: center;
			justify-content: center;
			color: #727272;
		}
	}
	
	.list-title {
		height: 88upx;
		line-height: 88upx;
		background: #fff;
		border-bottom: 1px solid #CCCCCC;
		display: flex;
		justify-content: space-between;
	
		&-wrapper {
			text-align: center;
			flex: 1;
		}
	}
	
	.list-wrapper {
		// height: calc(100% - 88upx);
		height: 100%;
	
		.scroll-Y {
			height: 100%;
		}
	
		&-box {
			background: #fff;
			display: flex;
			flex: 1;
			padding: 0 30upx;
			margin-bottom: 20upx;
	
			&-left {
				padding-right: 30upx;
				padding-top: 30upx;
	
				&-img {
					width: 60upx;
					height: 60upx;
				}
			}
	
			&-right {
				flex: 1;
				padding-top: 10upx;
	
				&-title {
					display: flex;
					justify-content: space-between;
	
					&-left {
						font-size: 32upx;
						line-height: 60upx;
					}
				}
			}
		}
	
		.list-test {
			font-size: 24upx;
			color: #c7c7c7;
			&.list-wrapper-box-right-title-right {
				line-height: 60upx;
			}
		}
	}

	.com-detail{
		.process {
			margin-left: 16upx;
		}
		.list-wrapper-box{
			.uni-view{
				flex: 1;
			}
			.process-btn-box{
				display: flex;
				.process-btn{
					flex: 1;
					margin: 0 40upx;
				}
			}
		}	
	}
</style>
